3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next

Strings

In a text file, a string is a sequence of ASCII text symbols enclosed in double quotation marks.

Only the following escape sequences may occur in a text file string:

\n
newline
\r
carriage return
\t
horizontal tab
\v
vertical tab
\\
backslash
\'
single quotation mark
\"
double quotation mark

In a binary file, a string is represented by a string of zero-terminated padded characters. The size of a string in a binary file is determined as follows (note that we add 1 to the length to account for the terminating \0):

    len = strlen(string) + 1;
    remainder = len % 4;
    pad = ( (remainder > 0) ? (4 - remainder) : 0 );
    size = len + pad;

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next